<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<link rel="stylesheet" type="text/css" href="<s:url value='/CSS/back/product/product_list.css'/>"/>
<table class="view-products">
  <caption>View Products</caption>
  <tr class="tr1">
    <td class="td1">Name</td>
    <td class="td2">Type</td>
    <td class="td3">BasePrice</td>
    <td class="td4">SalesPrice</td>
    <td class="td5">IsRecommended</td>
    <td class="td6">SexRequet</td>
    <td class="td7">Edit</td>
    <td class="td8">Delete</td>
  </tr>
  <s:iterator var="product" value="pagination.list" status="stat">
    <tr class="tr2" id="row_<s:property value='#stat.index'/>"
          onmouseover="onChange('row_<s:property value='#stat.index'/>', 0)"
          onmouseout="onChange('row_<s:property value='#stat.index'/>', 1)">
      <td class="td1">
        <s:a action="productAction_edit" namespace="/back/product">
          <s:param name="product.productId" value="#product.productId"/>
          <s:property value="#product.name"/>
        </s:a>
      </td>
      <td class="td2"><s:property value="#product.productType.name"/></td>
      <td class="td3"><s:property value="#product.basePrice"/></td>
      <td class="td4"><s:property value="#product.salesPrice"/></td>
      <td class="td5">
        <s:if test="#product.isRecommended == 1">
          Yes
        </s:if>
        <s:else>
          No
        </s:else>
      </td>
      <td class="td6"><s:property value="#product.sexRequest.name"/></td>
      <td class="td7">
        <s:a action="productAction_edit" namespace="/back/product">
          <s:param name="product.productId" value="#product.productId"/>
          Edit
        </s:a>
      </td>
      <td class="td8">
        <s:a action="productAction_delete" namespace="/back/product">
          <s:param name="product.productId" value="#product.productId"/>
          Delete
        </s:a>
      </td>
    </tr>
  </s:iterator>
</table>
<s:url action="productAction_list" namespace="/back/product" var="first">
  <s:param name="pageNo" value="1"/>
</s:url>
<s:url action="productAction_list" namespace="/back/product" var="previous">
  <s:param name="pageNo" value="pagination.pageNo - 1"/>
</s:url>
<s:url action="productAction_list" namespace="/back/product" var="next">
  <s:param name="pageNo" value="pagination.pageNo + 1"/>
</s:url>
<s:url action="productAction_list" namespace="/back/product" var="last">
  <s:param name="pageNo" value="pagination.lastPageNo"/>
</s:url>
<s:include value="/WEB-INF/JSP/pagination.jsp"/>
<script type="text/javascript" src="<s:url value='/JS/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<s:url value='/JS/common.js'/>"></script>